package cn.edu.sdjzu.dao;

import cn.edu.sdjzu.entity.School;
import cn.edu.sdjzu.exception.BaseException;
import cn.edu.sdjzu.util.Condition;
import cn.edu.sdjzu.util.Pagination;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.Collection;
import java.util.List;

public interface SchoolDao {
    /**
     * 返回id对应的School对象
     *
     * @param id 对象对应的id
     * @return School对象
     * @throws SQLException
     */
    School find(Integer id) throws SQLException,BaseException;

    /**
     * 返回某页上的School对象
     * @param pagination 分页对象(页号, 每页面对象数)
     * @return School对象集合
     * @throws SQLException
     */
    Collection<School> findAll(Pagination pagination) throws SQLException, BaseException ;

    /**
     * 返回School所有对象
     * @return School对象集合
     * @throws SQLException
     */
    public Collection<School> findAll() throws SQLException, BaseException ;

    public Collection<School> findAll(Pagination pagination, List<Condition> conditionList)
            throws SQLException, BaseException;

    public boolean delete(Integer id) throws SQLException ;
    boolean update(Connection connection, School school) throws SQLException;

    boolean add(Connection connection, School school) throws SQLException;
    boolean delete(School school) throws SQLException;


}
